package com.zfx.mapper;

import com.zfx.pojo.Template;
import com.zfx.pojo.User;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface ITemplateMapper extends Mapper<Template> {

    @Select("<script>select * from tbs_template where 1=1 " +
            "<if test='modeId != null'> and modeId = #{modeId}</if>" +
            "<if test='modeName != null'> and modeName like #{modeName}</if></script>")
    List<Template> findByIdAndName(Template template);

    @Select("<script>select count(*) from tbs_template where 1=1 " +
            "<if test='modeId != null'> and modeId = #{modeId}</if>" +
            "<if test='modeName != null'> and modeName like #{modeName}</if></script>")
    int countByIdAndName(Template template);
}
